import React, {Component} from 'react';
import {Route,Switch} from "react-router-dom";
import Message from "./Messages";
import News from "./News";
import MyNavLink from "../../components/MyNavLink";

class Home extends Component {
    render() {
        return (
            <div>
                <h2>Home组件内容</h2>
                <div>
                    <ul className="nav nav-tabs">
                        <li>
                            <MyNavLink to={'/home/news'}>News</MyNavLink>
                            {/*<a className="list-group-item active" href="./home-news.html">News</a>*/}
                        </li>
                        <li>
                            <MyNavLink to={'/home/message'}>Message</MyNavLink>
                            {/*<a className="list-group-item " href="./home-message.html">Message</a>*/}
                        </li>
                    </ul>
                    <Switch>
                        <Route path={'/home/message'} component={Message}></Route>
                        <Route path={'/home/news'} component={News}></Route>
                    </Switch>
                </div>
            </div>
        );
    }
}

export default Home;